From 1f79e130d5d1a29b110d2e9fba87715c9e955689 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Wed, 25 Apr 2007 13:44:37 +0100 Subject: [PATCH] Translate network uuid to bridge name and store it in XendConfig when createing a new vif. Fixes a bug where a new vif gets added to the wrong bridge. signed-off-by: Tom Wilkie --- tools/python/xen/xend/XendConfig.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 7622c8b809..48704afe61 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -341,7 +341,7 @@ class XendConfig(dict): # try and 'fix it up' but acutually fix the cause ;-) # def _memory_sanity_check(self): - log.debug("_memory_sanity_check memory_static_min: %s, " + log.trace("_memory_sanity_check memory_static_min: %s, " "memory_static_max: %i, " "memory_dynamic_min: %i, " "memory_dynamic_max: %i", @@ -1049,6 +1049,11 @@ class XendConfig(dict): dev_info['type'] = cfg_xenapi.get('type') if cfg_xenapi.get('name'): dev_info['name'] = cfg_xenapi.get('name') + if cfg_xenapi.get('network'): + from xen.xend.XendNode import XendAPIInstanceStore + network = XendAPIInstanceStore.get( + cfg_xenapi.get('network'), 'network') + dev_info['bridge'] = network.get_name_label() dev_uuid = cfg_xenapi.get('uuid', None) if not dev_uuid: -- 2.30.2